<?php

namespace App\Http\Controllers;

use App\Library\Requests\Base\SerialNumberRequest;
use App\Library\Requests\Logistic\LogisticEditRequest;
use App\Library\Requests\Logistic\LogisticSendRequest;
use App\Library\Service\LogisticService;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Http\JsonResponse;

class LogisticController extends BaseController
{
    /**
     * @param LogisticService $service
     */
    public function __construct(LogisticService $service)
    {
        $this->service = $service;
    }

    /**
     * 物流查询
     * @param SerialNumberRequest $request
     * @return JsonResponse
     *
     * @throws GuzzleException
     */
    public function logisticInfo(SerialNumberRequest $request): JsonResponse
    {
        return $this->service->logisticInfo($request);
    }

    public function edit(LogisticEditRequest $request): JsonResponse
    {
        return $this->service->edit($request);
    }

    /**
     *
     * @param LogisticSendRequest $request
     * @return JsonResponse
     *
     */
    public function send(LogisticSendRequest $request): JsonResponse
    {
        return $this->service->send($request);
    }
}
